#!/bin/bash

if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
    set -x
fi
set -eu
set -o pipefail

IMAGE_NAME=${IMAGE_NAME:-'image'}

sudo chmod a+r $TMP_MOUNT_PATH/tmp/ramdisk $TMP_MOUNT_PATH/tmp/kernel
cp $TMP_MOUNT_PATH/tmp/ramdisk $IMAGE_NAME.initramfs
cp $TMP_MOUNT_PATH/tmp/kernel $IMAGE_NAME.kernel
